import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedstate from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    num:1
  },
  getters: {
  },
  mutations: {
    //方法名(state){//操作state的数据}
    increment(state){
      state.num++
    }
  },
  actions: {
  },
  modules: {
  },
  plugins:[
    createPersistedstate({
      key:'num_key_store',
      paths:['num']
    })
  ]
})
